home *** CD-ROM | disk | FTP | other *** search
/ Mac-Source 1994 July / Mac-Source_July_1994.iso / C and C++ / Entertainment / MacMud / Mud 4.0 / comm.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-03-17  |  1.4 KB  |  41 lines  |  [TEXT/MPS ]

  1.  
  2. #include <sys/socket.h>
  3. #include <netinet/in.h>
  4. #include <arpa/inet.h>
  5.  
  6. #define MAX_TEXT    2048
  7.  
  8. #define MAX_SOCKET_PACKET_SIZE    1024    /* Wild guess. */
  9. #define DESIRED_SOCKET_PACKET_SIZE 800
  10.  
  11. #define MESSAGE_FLUSH ((char*)NULL)
  12.  
  13. struct interactive {
  14.     int socket;
  15.     struct object *ob;        /* Points to the associated object */
  16.     struct sentence *input_to;    /* To be called with next input line ! */
  17.  
  18.     long window;
  19.     struct sockaddr_in addr;
  20.  
  21.     char *prompt;
  22.     int closing;        /* True when closing this socket. */
  23.     int do_close;        /* This is to be closed down. */
  24.     char text[MAX_TEXT];
  25.     int text_end;        /* first free char in buffer */
  26.     int text_start;        /* where we are up to in player cmd buffer */
  27.     struct interactive *snoop_on, *snoop_by;
  28.     int noecho;            /* Don't echo lines */
  29.     int last_time;        /* Time of last command executed */
  30.     char *default_err_message;    /* This or What ? is printed when error */
  31. #ifdef ACCESS_RESTRICTED
  32.     void *access_class;         /* represents a "cluster" where this player comes from */                              
  33. #endif
  34.     int trace_level;        /* Debug flags. 0 means no debugging */
  35.     char *trace_prefix;        /* Trace only object which has this as name prefix */
  36.     struct ed_buffer *ed_buffer;    /* Local ed */
  37.     int message_length;
  38.     char message_buf[DESIRED_SOCKET_PACKET_SIZE+1];
  39.     struct object *next_player_for_flush, *previous_player_for_flush;
  40. };
  41.